package com.tarena.lbs.business.dao.repository.impl;

import com.tarena.lbs.business.dao.mapper.BusinessMapper;
import com.tarena.lbs.business.dao.repository.BusinessRepository;
import com.tarena.lbs.business.pojo.po.BusinessPO;
import com.tarena.lbs.business.pojo.query.BusinessQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class BusinessRepositoryImpl implements BusinessRepository {
    @Autowired
    private BusinessMapper businessMapper;

    @Override
    public List<BusinessPO> list(BusinessQuery query) {
        List<BusinessPO> pos=businessMapper.selectBusinessList(query);
        return pos;
    }

    @Override
    public void addBusiness(BusinessPO po) {
        businessMapper.insert(po);
    }

    @Override
    public BusinessPO selectById(Integer businessId) {
        BusinessPO po=businessMapper.selectById(businessId);
        return po;
    }
}
